import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/loginView',
      component: () => import('@/views/LoginView.vue'),
    },
    {
      path: '/',
      component: () => import('@/views/MainView.vue'),
      redirect: '/memberList',
      children: [
        {
          path: '/home',
          name: 'home',
          component: HomeView,
        },
        {
          path: '/about',
          name: 'about',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/AboutView.vue'),
        },

        {
          path: '/memberLevelAdd',
          component: () => import('@/views/member/MemberLevelAdd.vue'),
        },
        {
          path: '/memberLevelList',
          component: () => import('@/views/member/MemberLevelList.vue'),
        },
        {
          path: '/memberAdd',
          component: () => import('@/views/member/MemberAdd.vue'),
        },
        {
          path: '/memberList',
          component: () => import('@/views/member/MemberList.vue'),
        },
        {
          path: '/memberUpdate',
          component: () => import('@/views/member/MemberUpdate.vue'),
        },
        {
          path: '/memberDetail',
          component: () => import('../views/member/MemberDetail.vue'),
        },
        {
          path: '/shopAdd',
          component: () => import('@/views/shop/ShopAdd.vue'),
        },
        {
          path: '/shopList',
          component: () => import('@/views/shop/ShopList.vue'),
        },
        {
          path: '/shopUpdate',
          component: () => import('@/views/shop/ShopUpdate.vue'),
        },
        {
          path: '/shopCountList',
          component: () => import('@/views/shop/ShopCountList.vue'),
        },
        {
          path: '/discountAdd',
          component: () => import('@/views/discount/DiscountAdd.vue'),
        },
        {
          path: '/discountList',
          component: () => import('@/views/discount/DiscountList.vue'),
        },
        {
          path: '/testList',
          component: () => import('@/views/test/TestList.vue'),
        },
        {
          path: '/testUpdate',
          component: () => import('@/views/test/TestUpdate.vue'),
        },
        {
          path: '/houseTypeAdd',
          component: () => import('@/views/house/HouseTypeAdd.vue'),
        },
        {
          path: '/houseTypeList',
          component: () => import('@/views/house/HouseTypeList.vue'),
        },
        {
          path: '/houseNoAdd',
          component: () => import('@/views/house/HouseNoAdd.vue'),
        },
        {
          path: '/houseNoList',
          component: () => import('@/views/house/HouseNoList.vue'),
        },
        {
          path: '/houseRowAdd',
          component: () => import('@/views/house/HouseRowAdd.vue'),
        },
        {
          path: '/shopListNew',
          component: () => import('@/views/shop/ShopListNew.vue'),
        },
        {
          path: '/shopUpdateNew',
          component: () => import('@/views/shop/ShopUpdateNew.vue'),
        },
        {
          path: '/memberRightAdd',
          component: () => import('@/views/member/MemberRightAdd.vue'),
        },
        {
          path: '/memberLevelUpdate',
          component: () => import('@/views/member/MemberLevelUpdate.vue'),
        },
        {
          path: '/housePriceAdd',
          component: () => import('@/views/house/HousePriceAdd.vue'),
        },
      ],
    },
  ],
});

export default router;
